package com.heima.behavior.controller.v1;


import com.heima.behavior.service.LikeBehaviorService;
import com.heima.model.behavior.dtos.LikesBehaviorDto;
import com.heima.model.behavior.dtos.ReadBehaviorDto;
import com.heima.model.behavior.dtos.UnLikesBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1")


public class LikeBehaviorController {

    @Autowired
    private LikeBehaviorService likeBehaviorService;
    @PostMapping("/likes_behavior")
    public ResponseResult likeBehavior(@RequestBody LikesBehaviorDto dto){
        return likeBehaviorService.likeBehavior(dto);
    }

    //阅读

    @PostMapping("read_behavior")
    public ResponseResult readBehavior (@RequestBody ReadBehaviorDto dto){
        return likeBehaviorService.readBehavior(dto);

    }
    @PostMapping("un_likes_behavior")
    public ResponseResult unLikeBehavior( @RequestBody  UnLikesBehaviorDto dto){
        return likeBehaviorService.unLikeBehavior(dto);
    }

}
